package com.example.blades.mymusicservice;

import android.provider.MediaStore;
import android.support.v4.media.session.PlaybackStateCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.app.Service;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.IBinder;

public class Music extends Service {

    private MediaPlayer player;

    @Override
    public IBinder onBind(Intent intent)
    {
        return null;
    }

    public void onStart(Intent intent,int startId)
    {
        super.onStart(intent,startId);
        player=MediaPlayer.create(this,R.raw.rainbow);
        player.start();
    }

    public void onDestroy()
    {
        super.onDestroy();
        player.stop();
    }


}